import { Component, OnInit } from '@angular/core';
import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture/ngx';

@Component({
  selector: 'app-testmedia',
  templateUrl: './testmedia.page.html',
  styleUrls: ['./testmedia.page.scss'],
})
export class TestmediaPage implements OnInit {
  imgurl:string;
  constructor(private mediaCapture: MediaCapture) { }

  ngOnInit() {

  }
  takephoto() {
    let options: CaptureImageOptions = { limit: 1 }
    this.mediaCapture.captureImage(options)
      .then(
        (data: MediaFile[]) =>{
          // alert(data);
this.imgurl = data[0].fullPath;
     alert(this.imgurl);
        },
        (err: CaptureError) => console.error(err)
      );
  }
}
